//组件状态管理-useState
import React, { useState } from "react";

const App = () => {
  const [cou2, setCou2] = React.useState(100);
  //React.useState(0)或useState
  const [count, setCount] = useState(0);

  let [cou3, setCou3] = useState(0);
  const hClick = () => {
    setCou3(cou3++);
  };
  return (
    <>
      <div>{count}</div>
      <div>{cou2}</div>

      <button onClick={() => setCount(count + 10)}>click+10</button>
      <br></br>
      <button onClick={() => setCou2(cou2 + 100)}>click+100</button>
      <br></br>
      <button onClick={hClick}>click++</button>
      <p>Count: {cou3}</p>
    </>
  );
};
export default App;
